package task;

public class Task6_1 {
    public static double avg(int[] array){
        if(array == null) return 0;
        double sum = 0.0;
        for (int i = 0; i < array.length; i++) {
            sum = sum + array[i];
        }
        return sum / array.length;

    }
    public static void main(String[] args) {
        int[] array = {1,2,3,4,5,4};
        System.out.println(avg(array));
    }
}
